<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
   <link rel="stylesheet" href="../css/validationEngine.jquery.css"
	type="text/css" />
<script src="../js/jquery.validationEngine-en.js" type="text/javascript"
	charset="utf-8">
	
</script>
<script src="../js/jquery.validationEngine.js" type="text/javascript"
	charset="utf-8">
	
</script>
<script>
	jQuery(document).ready(function() {
		// binds form submission and fields to the validation engine
	  	jQuery("#formChangePassword").validationEngine('attach');		
	});	   
	    
	$.subscribe('beforeForm', function(event,data) {		
				
		/*var fData = event.originalEvent.formData;			
		 var form1 = event.originalEvent.form[0]; 			
		if(form1.oldPassword.value.trim().length==0){
			event.originalEvent.options.submit = false; 				
		}else if(form1.newPassword.value.trim().length==0)
		{
			event.originalEvent.options.submit = false; 
		}else if(form1.newPassword.value.trim().length==0)
		{
			event.originalEvent.options.submit = false; 
		}*/
		
		
	    });		
</script>
<h3 class='pageTitle'><span>Thay đổi mật khẩu</span></h3>

<s:form id="formChangePassword" method="post" action="#" theme="simple"
	cssClass="yform">
	<div class="type-text"><s:actionerror
		cssStyle="padding:20px 30px; color: red; font-size:17px;" /> <label
		for="echo">Mật khẩu cũ: </label> <s:password id="oldPassword"
		name="oldPassword" cssClass="validate[required,length[6,20]] txtField smallInput wide" value="" /> <label
		for="echo">Mật khẩu mới: </label> <s:password id="newPassword"
		name="newPassword" cssClass="validate[required,length[6,20]] txtField smallInput wide" value="" /> <label
		for="echo">Xác nhận mật khẩu mới: </label> <s:password id="confirmPassword"
		name="confirmPassword" cssClass="validate[required,length[6,20],confirm[newPassword]] txtField smallInput wide" value="" />
	</div>
	<div class="type-button" style="margin-left: 30%;"><s:url
		id="Dealer_finishChangePass" value="/Dealer_finishChangePass" /> <sj:submit
		title="Đổi mật khẩu" onBeforeTopics="beforeForm" onCompleteTopics="completeForm"
		id="subDealer_finishChangePass" href="%{Dealer_finishChangePass}"
		value="Cập nhật" targets="container" button="true" />
	<s:url id="Dealer_changePass_1_" value="/Dealer_changePass" /> <sj:a
		title="Nhập lại các trường dữ liệu" id="lnkDealer_changePass_1_" onclick="jQuery('#formChangePassword').validationEngine('hide')"
		href="%{Dealer_changePass_1_}" targets="container" button="true">
				      Nhập lại
				    </sj:a> <s:url id="Dealer_viewProfile"
		value="/Dealer_viewProfile.action" /> <sj:a
		title="Xem thông tin cá nhân" id="lnkDealer_viewProfile_1"
		href="%{Dealer_viewProfile}" targets="container" button="true">
				      Hủy
				    </sj:a></div>

</s:form>
